<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title><h:outputText value="#{index.constant.siteName}" /></title>
	<style>
.lable {
	border: thin;
	border-color: red;
	border: thin;
}

.row1 {
	background-color: gray;
}

.row2 {
	background-color: green;
}

.errorText {
	
}
</style>
</h:head>

<h:body>
<h:form>
	<h:panelGrid columns="3" rowClasses="row1, row2">
		<h:inputHidden id="id" value="#{linkBean.link.id}"></h:inputHidden>
		<h:outputLabel for="siteName" styleClass="lable">
			<h:outputText value="站点名称" />
		</h:outputLabel>
		<h:inputText id="siteName" value="#{linkBean.link.siteName }" size="50"
			required="true">
			<f:validateLength maximum="50" minimum="2"></f:validateLength>
		</h:inputText>
		<h:message for="siteName" styleClass="errorText" />

		<h:outputLabel for="url" styleClass="lable">
			<h:outputText value="url地址" />
		</h:outputLabel>
		<h:inputText id="url" value="#{linkBean.link.url }" size="50"
			required="true">
			<f:validateLength maximum="50" minimum="2"></f:validateLength>
		</h:inputText>
		<h:message for="url" styleClass="errorText" />

		<h:outputLabel for="email" styleClass="lable">
			<h:outputText value="站长email" />
		</h:outputLabel>
		<h:inputText id="email" value="#{linkBean.link.siteName }" size="50"
			required="true">
			<f:validateLength maximum="50" minimum="2"></f:validateLength>
		</h:inputText>
		<h:message for="email" styleClass="errorText" />

		<h:outputLabel for="state" styleClass="label">
			<h:outputText value="状态" />
		</h:outputLabel>
		<h:inputText id="state" value="#{linkBean.link.state}"></h:inputText>
		<h:message for="state" styleClass="errorText" />
	</h:panelGrid>
	<br></br>
	<h:commandButton id="submitAdd" value="AddLink" action="#{linkBean.save}" rendered="#{ not linkBean.editModel }"></h:commandButton>
	<h:commandButton id="submitUpdate" value="修改" action="#{linkBean.update}" rendered="#{ linkBean.editModel }"></h:commandButton>
</h:form>
</h:body>
</html>